import request from '@/utils/request'

// 查询产品小类列表
export function listSubclass(query) {
  return request({
    url: '/funct/subclass/list',
    method: 'get',
    params: query
  })
}

// 查询所有小类列表
export function listSubclassAll(categoryId) {
  return request({
    url: '/funct/subclass/listAll?categoryId=' + categoryId,
    method: 'get'
  })
}

// 查询产品小类详细
export function getSubclass(id) {
  return request({
    url: '/funct/subclass/' + id,
    method: 'get'
  })
}

// 新增产品小类
export function addSubclass(data) {
  return request({
    url: '/funct/subclass',
    method: 'post',
    data: data
  })
}

// 修改产品小类
export function updateSubclass(data) {
  return request({
    url: '/funct/subclass',
    method: 'put',
    data: data
  })
}

// 删除产品小类
export function delSubclass(id) {
  return request({
    url: '/funct/subclass/' + id,
    method: 'delete'
  })
}
